{php include wl_template('common/header');}
<div class="pages-dashboard">
	<div class="dashb-h">{if $name}{$name}{else}{php echo $_W['wlsetting']['base']['name']?$_W['wlsetting']['base']['name']:$_W['account']['name']}{/if}</div>
	<div class="dashb-c">
		<div class="dashb-c-d">
			<div class="dashb-c-t1 dashb-c-top">
				<div class="dashb-c-p-title">
					<span>实时概况</span><i>更新时间：{php echo date('Y-m-d H:i:s', time())}</i>
				</div>
				<div class="dashb-c-t1-c">
					<div class="dashb-c-p">
						<div class="dashb-c-p-l">
							<div class="icon p-l-icon1"><i class="icon iconfont icon-moneybagfill"></i></div>
						</div>
						<div class="dashb-c-p-r">
							<div class="h2">支付金额(元)</div>
							<div class="h1" id="html-allmoney-today">--</div>
							<div class="p" id="html-allmoney-yestoday">昨日：--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">退款金额(元)</div>
							<div class="h1" id="html-refund-today">--</div>
							<div class="p" id="html-refund-yestoday">昨日：--</div>
						</div>
					</div>
					{if !is_store()}
					<div class="dashb-c-p">
						<div class="dashb-c-p-l">
							<div class="icon p-l-icon2"><i class="icon iconfont icon-shopfill"></i></div>
						</div>
						<div class="dashb-c-p-r">
							<div class="h2">新增商户数</div>
							<div class="h1" id="html-store-today">--</div>
							<div class="p" id="html-store-yestoday">昨日：--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">在线付费入驻数</div>
							<div class="h1" id="html-newcharge-today">--</div>
							<div class="p" id="html-newcharge-yestoday">昨日：--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-l">
							<div class="icon p-l-icon3"><i class="icon iconfont icon-peoplefill"></i></div>
						</div>
						<div class="dashb-c-p-r">
							<div class="h2">新增客户数</div>
							<div class="h1" id="html-newmember-today">--</div>
							<div class="p" id="html-newmember-yestoday">昨日：--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">支付客户数</div>
							<div class="h1" id="html-paymember-today">--</div>
							<div class="p" id="html-paymember-yestoday">昨日：--</div>
						</div>
					</div>
					{/if}
					<div class="dashb-c-p">
						<div class="dashb-c-p-l">
							<div class="icon p-l-icon4"><i class="icon iconfont icon-caifub"></i></div>
						</div>
						<div class="dashb-c-p-r">
							<div class="h2">新增订单数</div>
							<div class="h1" id="html-order-today">--</div>
							<div class="p" id="html-order-yestoday">昨日：--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">支付订单数</div>
							<div class="h1" id="html-payorder-today">--</div>
							<div class="p" id="html-payorder-yestoday">昨日：--</div>
						</div>
					</div>
				</div>
			</div>
			{if !is_store()}
			<div class="dashb-c-t1 dashb-c-top">
			    <div class="dashb-c-p-title">
                    <span>重要提醒</span>
                </div>
                <div class="dashb-c-t1-c">
                    <div class="item">
                        <div class="item_tit">订单相关</div>
                        <div class="item_body">
                            <a href="{php echo web_url('order/wlOrder/orderlist',array('status'=>8))}"><div class="item_info">待发货订单：<span id="order-dfh">0</span></div></a>
                            <a href="{php echo web_url('order/wlOrder/orderlist',array('status'=>6))}"><div class="item_info">待退款订单：<span id="order-dtk">0</span></div></a>
							<a href="{php echo web_url('order/orderAfterSales/afterlist',array('status'=>1))}"><div class="item_info">申请退款记录：<span id="order-sqtk">0</span></div></a>
                        </div>
                    </div>
                    {if is_agent()}
                    <div class="item">
                        <div class="item_tit">商家相关</div>
                        <div class="item_body">
                            <a href="{php echo web_url('store/storeApply/index')}"><div class="item_info">入驻待审核：<span id="merchantnum">0</span></div></a>
                            <a href="{php echo web_url('store/storeDynamic/dynamic',array('type'=>4))}"><div class="item_info">动态待审核：<span id="dynamicnum">0</span></div></a>
                            <a href="{php echo web_url('store/storeComment/index',array('checkone'=>1))}"><div class="item_info">评价待审核：<span id="commentnum">0</span></div></a>
                        </div>
                    </div>
                    {/if}
                    {if !is_agent()}
                    <div class="item">
                        <div class="item_tit">财务相关</div>
                        <div class="item_body">
                            <a href="{php echo web_url('finace/finaceWithdrawalApply/cashApply',array('type'=>1,'status'=>2))}"><div class="item_info">商家提现申请：<span id="storeapply">0</span></div></a>
                            <a href="{php echo web_url('finace/finaceWithdrawalApply/cashApply',array('type'=>2,'status'=>2))}"><div class="item_info">代理提现申请：<span id="agentapply">0</span></div></a>
                            <a href="{php echo web_url('finace/finaceWithdrawalApply/cashApply',array('type'=>3,'status'=>2))}"><div class="item_info">分销提现申请：<span id="disapply">0</span></div></a>
                        </div>
                    </div>
                    {/if}
                    <div class="item">
                        <div class="item_tit">其他信息</div>
                        <div class="item_body">
                    		{if is_agent()}
                            <a href="{php echo web_url('pocket/Tiezi/lists',array('status'=>1))}"><div class="item_info">帖子待审核：<span id="pocketnum">0</span></div></a>
                            <a href="{php echo web_url('rush/active/activelist',array('status'=>5))}"><div class="item_info">抢购待审核：<span id="rushnum">0</span></div></a>
                            <a href="{php echo web_url('groupon/active/activelist',array('status'=>5))}"><div class="item_info">团购待审核：<span id="grouponnum">0</span></div></a>
							{if agent_p('citydelivery')}
							<a href="{php echo web_url('citydelivery/active/activelist',array('status'=>5))}"><div class="item_info">配送待审核：<span id="citydeliverynum">0</span></div></a>
							{/if}
							{if agent_p('attestation')}
							<a href="{php echo web_url('attestation/attestation/attestationList',['checkstatus' => 1])}"><div class="item_info">认证待审核：<span id="aattnum">0</span></div></a>
							{/if}
							{else}
                            <a href="{php echo web_url('distribution/dissysbase/adddistributor')}"><div class="item_info">分销商申请待审核：<span id="disnum">0</span></div></a>
							 <a href="{php echo web_url('store/storeApply/index')}"><div class="item_info">商户入驻待审核：<span id="merchantnum">0</span></div></a>
							 <a href="{php echo web_url('store/storeDynamic/dynamic',array('type'=>4))}"><div class="item_info">动态待审核：<span id="dynamicnum">0</span></div></a>
							 <a href="{php echo web_url('store/storeComment/index',array('checkone'=>1))}"><div class="item_info">评价待审核：<span id="commentnum">0</span></div></a>
							{if uniacid_p('attestation')}
							<a href="{php echo web_url('attestation/attestation/attestationList',['checkstatus' => 1])}"><div class="item_info">认证待审核：<span id="uattnum">0</span></div></a>
							{/if}
							{/if}
                        </div>
                    </div>
                </div>
			</div>
			{/if}
			<div class="dashb-c-t2 dashb-c-top">
				<div class="dashb-c-p-title">
					<span>交易金额</span>
				</div>
				<div class="dashb-c-t2-c">
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">今日支付金额(元)</div>
							<div class="h1" id="html-allmoney">--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">昨日支付金额(元)</div>
							<div class="h1" id="html-yesmoney">--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">近七日支付金额(元)</div>
							<div class="h1" id="html-sevenmoney">--</div>
						</div>
					</div>
					<div class="dashb-c-p">
						<div class="dashb-c-p-r">
							<div class="h2">近三十日支付金额(元)</div>
							<div class="h1" id="html-threemoney">--</div>
						</div>
					</div>
				</div>
				<div class="dashb-c-t2-b">
					<div id="mountNode"></div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	myrequire(['g2','data-set'],function(){
		$.post(location.href, function(stat){
			var data = $.parseJSON(stat);
			console.log(data);
			var chart = new G2.Chart({
			  	container: 'mountNode',
			  	forceFit: true,
			  	height: 500
			});
			chart.source(data.list);
			chart.scale('金额', {});
			chart.interval().position('year*金额');
			chart.render();

			$('#html-allmoney-today').html(data.allmoney);
			$('#html-allmoney-yestoday').html('昨日：' + data.yesmoney);
			$('#html-refund-today').html(data.refmoney);
			$('#html-refund-yestoday').html('昨日：' + data.refyesmoney);
			$('#html-store-today').html(data.newmerchant);
			$('#html-store-yestoday').html('昨日：' + data.yesnewmerchant);
			$('#html-newcharge-today').html(data.newcharge);
			$('#html-newcharge-yestoday').html('昨日：' + data.yesnewcharge);
			$('#html-newmember-today').html(data.newmember);
			$('#html-newmember-yestoday').html('昨日：' + data.yesnewmember);
			$('#html-paymember-today').html(data.paymember);
			$('#html-paymember-yestoday').html('昨日：' + data.yespaymember);
			$('#html-order-today').html(data.neworder);
			$('#html-order-yestoday').html('昨日：' + data.yesneworder);
			$('#html-payorder-today').html(data.newpayorder);
			$('#html-payorder-yestoday').html('昨日：' + data.yesnewpayorder);

			$('#html-allmoney').html(data.allmoney);
			$('#html-yesmoney').html(data.yesmoney);
			$('#html-sevenmoney').html(data.sevenmoney);
			$('#html-threemoney').html(data.threemoney);
			
			//重要提醒
			$('#order-dfh').html(data.dfhorder);
			$('#order-dtk').html(data.dtkorder);
			$('#order-sqtk').html(data.sqtkorder);
			$('#merchantnum').html(data.merchantnum);
			$('#dynamicnum').html(data.dynamicnum);
			$('#commentnum').html(data.commentnum);
			$('#storeapply').html(data.storeapply);
			$('#agentapply').html(data.agentapply);
			$('#disapply').html(data.disapply);
			$('#pocketnum').html(data.pocketnum);
			$('#disnum').html(data.disnum);
            $('#aattnum').html(data.aattnum);
			$('#uattnum').html(data.uattnum);
			$('#rushnum').html(data.rushnum);
			$('#grouponnum').html(data.grouponnum);
			$('#citydeliverynum').html(data.citydeliverynum);
		});
	})
</script>
{php include wl_template('common/footer');}